package com.model;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;
@Entity
@Table(name="tb_receipt")
public class ReceiptBean implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -7616161123499507046L;
	@Id
	@GenericGenerator(name = "idGenerator", strategy = "sequence", parameters = { @Parameter(name = "sequence", value = "SEQ_RECEIPT") })
	@GeneratedValue(generator = "idGenerator")
	private Long id;
	private String no;			//单据id
	private String receipt_data;
	private String receipt_type;//单据类型(出库单/报废单/调拨单等)
	private Integer dept_id;  //使用部门   调拨接收部门，出库接收部门  
	private String user_id; //制单人 or 盘点人
	@Column(columnDefinition="number(10,2)")
	private Double receipt_money;//总金额 
	private String receipt_remark;//备注  or 单据说明
	private String staff_name;//领用人
	@OneToMany(fetch=FetchType.LAZY,cascade=CascadeType.ALL,mappedBy="receipt_id")
	@Fetch(FetchMode.SELECT)
	private Set<ReceiptDetailsBean> receiptdetails_list;
	
	/*
	 * 盘点
	 */
	private Integer sys_amount;//系统数量
	private Integer real_amount;//实际
	private Integer d_amount;//差异
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getNo() {
		return no;
	}
	public void setNo(String no) {
		this.no = no;
	}
	public String getReceipt_data() {
		return receipt_data;
	}
	public void setReceipt_data(String receipt_data) {
		this.receipt_data = receipt_data;
	}
	public String getReceipt_type() {
		return receipt_type;
	}
	public void setReceipt_type(String receipt_type) {
		this.receipt_type = receipt_type;
	}
	public Integer getDept_id() {
		return dept_id;
	}
	public void setDept_id(Integer dept_id) {
		this.dept_id = dept_id;
	}
	public String getUser_id() {
		return user_id;
	}
	public void setUser_id(String user_id) {
		this.user_id = user_id;
	}
	public Double getReceipt_money() {
		return receipt_money;
	}
	public void setReceipt_money(Double receipt_money) {
		this.receipt_money = receipt_money;
	}
	public String getStaff_name() {
		return staff_name;
	}
	public void setStaff_name(String staff_name) {
		this.staff_name = staff_name;
	}
	public Set<ReceiptDetailsBean> getReceiptdetails_list() {
		return receiptdetails_list;
	}
	public void setReceiptdetails_list(Set<ReceiptDetailsBean> receiptdetails_list) {
		this.receiptdetails_list = receiptdetails_list;
	}
	public String getReceipt_remark() {
		return receipt_remark;
	}
	public void setReceipt_remark(String receipt_remark) {
		this.receipt_remark = receipt_remark;
	}
	public Integer getSys_amount() {
		return sys_amount;
	}
	public void setSys_amount(Integer sys_amount) {
		this.sys_amount = sys_amount;
	}
	public Integer getReal_amount() {
		return real_amount;
	}
	public void setReal_amount(Integer real_amount) {
		this.real_amount = real_amount;
	}
	public Integer getD_amount() {
		return d_amount;
	}
	public void setD_amount(Integer d_amount) {
		this.d_amount = d_amount;
	}
	
}
